package com.biao.java8.starem_test;

import com.biao.java8.demo.pojo.Employee;

import java.util.ArrayList;
import java.util.List;

public class Test06_filter {
    public static void main(String[] args) {
        List<Employee> listEmployee = new ArrayList<>();
        listEmployee.add(new Employee("abiu", 18, 8000d));
        listEmployee.add(new Employee("二狗", 24, 16000d));
        listEmployee.add(new Employee("黑狗哥", 27, 24000d));

        // filter 用法
        System.out.println("filter: --------------------------------");
        listEmployee.stream().filter((a) -> "abiu".equals(a.getName()) && 18 == a.getAge()).forEach(System.out::println);
    }
}
